<template>
  <div class="swiper">
    <div class="swiper-left">
      <img src="@/assets/img/toutiao.png"/>
    </div>
    <div class="swiper-right">
      <div class="wrapper">
        <swiper :options="swiperOption">
          <swiper-slide v-for="item of swiperList" :key="item.id">
            <img class="swiper-img" :src="item.imgUrl" />
          </swiper-slide>
          <div class="swiper-pagination"  slot="pagination"></div>
        </swiper>
      </div>
    </div>
  </div>
</template>
<script>
import shalong from '@/assets/img/shalong.jpg'
import bangdan from '@/assets/img/bangdan.jpg'
import data from '@/assets/img/data.jpg'
export default {
  name: 'HomeSwiper',
  data () {
    return {
      swiperOption: {
        pagination: '.swiper-pagination',
        paginationClickable: true,
        speed: 2000,
        loop: true,
        observer: true,
        observeParents: true,
        autoplayDisableOnInteraction: false,
        autoplay: 1500
      },
      swiperList: [{
        id: '0001',
        imgUrl: shalong
      }, {
        id: '0002',
        imgUrl: bangdan
      }, {
        id: '0003',
        imgUrl: data
      }]
    }
  }
}
</script>
<style lang="stylus" scoped>
  .swiper
    width: 1280px
    height: 300px
    margin: 0 auto
    .swiper-left
      width: 320px
      height: 300px
      float: left
    .swiper-right
      width: 960px
      height: 300px
      float: left
      .wrapper >>> .swiper-pagination-bullet-active
        background: #fff
      .wrapper
        overflow: hidden
        width: 100%
        height: 0
        padding-bottom: 31.25%
        .swiper-img
          width: 100%
</style>
